home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
CUJ9208.ARJ
/
RAMEY.EXE
/
STACK.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-10-14
|
1KB
|
59 lines
/*
Postman's Sort (R) Version 1.0
Copyright (c) Robert Ramey 1991. All Rights Reserved
*/
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
/*********************************************************************
data structure for memory blocks used to hold records in memory
after they have been read until the space is needed for something else.
**********************************************************************/
typedef struct {
unsigned int count;
size_t size;
} STK_BLK;
typedef struct {
STK_BLK current; /* end of stack */
STK_BLK pushed; /* last saved frame of stack */
STK_BLK previous; /* previous end of stack */
unsigned int frame_count;
} STACK;
/* commented out as these are implemented as macros */
/*
size_t
stk_avl(STACK *);
unsigned int
stk_blks(STACK *);
*/
unsigned int
stk_unused();
char *
stk_end(STACK *);
void
stk_windup();
unsigned int
stk_init(size_t, unsigned int);
void
stk_free(STACK *);
STACK *
stk_alloc();
void *
stk_space(STACK *, unsigned int);
void
stk_drop(STACK *);
int
stk_push(STACK *);
int
stk_pop(STACK *);
#define stk_blks(stk) (stk->current.count)
#define stk_avl(stk) (stk_blks(stk) ? stk->current.size : 0)